package com.zlp.spring.concurrent;

import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class OrderService {


    public OrederResp getOrderInfo(Long orderId, String serialNo) {

        OrederResp orederResp = new OrederResp();
        orederResp.setOrderId(orderId);
        orederResp.setOrderTime(getOrderTime());
        orederResp.setSerialNo(serialNo);
        return orederResp;
    }

    private String getOrderTime() {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss");
        return sdf.format(new Date());
    }
}
